var GameBlock = function () {

    var current = null;

    /**
     *   0 0 0
     *     0
     */
    var blockOne = function () {
        var blockArray = [
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeOne, GameConstant.blockType.typeOne, GameConstant.blockType.typeOne, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeOne, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore]
        ];
        return {blockType: GameConstant.blockType.typeOne, blockArray: blockArray};
    };

    /**
     *   0 0
     *     0
     *     0
     */
    var blockTwo = function () {
        var blockArray = [
            [GameConstant.blockType.typeTwo, GameConstant.blockType.typeTwo, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeTwo, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeTwo, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore]
        ];
        return {blockType: GameConstant.blockType.typeTwo, blockArray: blockArray};
    };

    /**
     *     0 0
     *     0
     *     0
     */
    var blockThree = function () {
        var blockArray = [
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeThree, GameConstant.blockType.typeThree, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeThree, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeThree, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore]
        ];
        return {blockType: GameConstant.blockType.typeThree, blockArray: blockArray};
    };

    /**
     *     0 0
     *   0 0
     */
    var blockFour = function () {
        var blockArray = [
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeFour, GameConstant.blockType.typeFour, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeFour, GameConstant.blockType.typeFour, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore]
        ];
        return {blockType: GameConstant.blockType.typeFour, blockArray: blockArray};
    };

    /**
     *   0 0
     *     0 0
     */
    var blockFive = function () {
        var blockArray = [
            [GameConstant.blockType.typeFive, GameConstant.blockType.typeFive, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeFive, GameConstant.blockType.typeFive, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore]
        ];
        return {blockType: GameConstant.blockType.typeFive, blockArray: blockArray};
    };

    /**
     *   0 0 0 0
     */
    var blockSix = function () {
        var blockArray = [
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeSix, GameConstant.blockType.typeSix, GameConstant.blockType.typeSix, GameConstant.blockType.typeSix],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore]
        ];
        return {blockType: GameConstant.blockType.typeSix, blockArray: blockArray};
    };

    /**
     *   0 0
     *   0 0
     */
    var blockSeven = function () {
        var blockArray = [
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeSeven, GameConstant.blockType.typeSeven, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeSeven, GameConstant.blockType.typeSeven, GameConstant.blockType.typeZore],
            [GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore, GameConstant.blockType.typeZore]
        ];
        return {blockType: GameConstant.blockType.typeSeven, blockArray: blockArray};
    };

    // 刚开始的出现点
    this.coordinate = {displayX: 0, displayY: 3};

    this.isBlockActive = true;

    /**
     * 初始化当前活动方块
     * @returns {*}
     */
    this.initCurrentBlock = function (randomIndex) {
        var blockArrays = [blockOne(), blockTwo(), blockThree(), blockFour(), blockFive(), blockSix(), blockSeven()];
        current = blockArrays[randomIndex];
        return current;
    };

    /**
     * 获取当前活动方块
     * @returns {*}
     */
    this.getCurrentBlock = function () {
        return current;
    };

};

